﻿using SpaceNeedle.City6473.Web.Data.Models;
using System.Web;



namespace SpaceNeedle.City6473.Web.Data
{
    public static class SessionWrapper
    {
        /// <summary>
        /// Propriedade que controla o usuário logado
        /// </summary>
        public static UsersAuthentication User
        {
            get
            {
                HttpContext context = HttpContext.Current;

                UsersAuthentication user = null;
                try { user = (UsersAuthentication)context.Session["UserLogged"]; }
                catch { }

                return user == null ? null : user;
            }
            set
            {
                HttpContext context = HttpContext.Current;
                if (context.Session != null)
                    context.Session["UserLogged"] = value;
            }
        }
    }
}
